<template>
  <el-container>
    <!-- 头部区域 -->
    <el-header style="text-align: right; font-size: 12px;display: flex; justify-content: space-between;">
      <el-row type="flex" justify="space-between">
        <h1>艾三维技术管理后台</h1>
        <el-col :span="2">
          <div class="userInfo">
            <p class="userIdentity">
              admin <i class="el-icon-caret-bottom"></i>
            </p>
            <div class="userMes">
              <img
                src="https://img.js.design/assets/smartFill/img341164da748e08.jpg"
              />
              <div class="user">
                <p>张三凤</p>
                <p>madike9212</p>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-header>
    <el-container>
      <!-- 侧边栏区域 -->
      <el-aside width="200px" style="background-color: rgb(15, 22, 66, 1)">
        <el-menu
          :default-openeds="['1', '2', '3', '4', '5', '6', '7', '8']"
          background-color="rgb(15, 22, 66, 1)"
          text-color="rgba(157, 163, 204, 1)"
        >
          <div class="switchCompany">
            <div class="image">
              <img src="../assets/Main/store.png" />
            </div>
            <div class="text">
              <p class="companyTitle">中国民营旗舰店</p>
              <p class="storeId">店铺ID：454630186</p>
            </div>
            <div class="icon">
              <i class="el-icon-d-caret"></i>
            </div>
            <div class="companyList">
              <div class="company" v-for="item in company" :key="item.id">
                <div class="image">
                  <img src="../assets/Main/store.png" />
                </div>
                <div class="text">
                  <p class="companyTitle">{{ item.title }}</p>
                  <p class="storeId">店铺ID：{{ item.id }}</p>
                </div>
                <div class="icon">
                  <i class="el-icon-d-caret"></i>
                </div>
              </div>
            </div>
          </div>
        </el-menu>
        <div class="elAsideDiv" @click="handleClick('Category')">商品分类</div>
        <div class="elAsideDiv" @click="handleClick('Branding')">品牌管理</div>
        <div class="elAsideDiv" @click="handleClick('SecKilling')">
          秒杀活动
        </div>
        <div class="elAsideDiv" @click="handleClick()">优惠券</div>
        <div class="elAsideDiv" @click="handleClick('FeatureRecommend')">
          专题推荐
        </div>
        <div class="elAsideDiv" @click="handleClick()">广告位管理</div>
      </el-aside>
      <!-- 列表区域 -->
      <el-main>
        <router-view></router-view>
      </el-main>    
    </el-container>
  </el-container>
</template>

<script>
import { mapGetters } from "vuex";

export default {
  data() {
    return {
      company: [
        {
          title: "中国民营旗舰店",
          id: "454630186",
        },
        {
          title: "广东分店",
          id: "554630186",
        },
        {
          title: "北京分店",
          id: "754630186",
        },
      ],
    };
  },
  created() {},
  methods: {
    handleClick(path) {
      this.$router.push({
        path,
      });
    },
  },
  computed: {
    ...mapGetters(["rowCount"]),
  },
};
</script>

<style>
* {
  margin: 0;
  padding: 0;
}

.el-container {
  width: 100vw;
  height: 100vh;
  background-color: rgba(247, 249, 250, 1);
}

/* 头部区域 */

.el-header {
  color: #333;
  line-height: 60px;
}

.el-header .el-row {
  margin-right: 45px;
}

.el-header .el-row .el-col {
  width: 51px;
}

.el-header .el-row .el-col:last-child {
  width: 120px;
}

.el-header .el-row .el-col:nth-child(-n + 5) {
  margin-top: 15px;
}

.el-header .el-row .el-col .hBox {
  display: flex;
  flex-direction: column;
  justify-items: center;
  align-items: center;
  box-sizing: border-box;
  color: rgba(94, 108, 132, 1);
}

.el-header .el-row .el-col .hBox .hIcon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-size: 16px 16px;
  background-image: url("../assets/Main/rule.png");
}

.el-header .el-row .el-col:nth-child(2) .hBox .hIcon {
  background-image: url("../assets/Main/tutorial.png");
}

.el-header .el-row .el-col:nth-child(3) .hBox .hIcon {
  position: relative;
  background-image: url("../assets/Main/message.png");
}

.el-header .el-row .el-col:nth-child(3) .hBox .hIcon .dotIcon {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 8px;
  height: 8px;
  background-size: 8px 8px;
  background-image: url("../assets/Main/dot.png");
}

.el-header .el-row .el-col:nth-child(4) .hBox .hIcon {
  background-image: url("../assets/Main/customerService.png");
}

.el-header .el-row .el-col:last-child .hBox .hIcon {
  background-image: url("../assets/Main/feedback.png");
}

.el-header .el-row .el-col .hBox .hIcon:hover,
.userInfo:hover {
  cursor: pointer;
}

.el-header .el-row .el-col .hBox .hText {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0px;
  line-height: 16.8px;
  margin-top: 8px;
}

.el-header .el-row .el-col .userInfo {
  display: flex;
  flex-direction: column;
  width: 120px;
  height: 60px;
  margin-left: 15px;
}

.el-header .el-row .el-col .userInfo p {
  font-size: 12px;
  font-weight: 400;
  line-height: 17.38px;
  opacity: 1;
  color: rgba(255, 255, 255, 1);
}

.el-header .el-row .el-col .userInfo .userMes {
  display: flex;
}

.el-header .el-row .el-col .userInfo .userMes img {
  width: 36px;
  height: 38px;
  border-radius: 18px;
}

.el-header .el-row .el-col .userInfo .userMes .user {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 8px;
}

.el-header .el-row .el-col .userInfo .userMes .user p:first-child {
  color: rgba(52, 69, 99, 1);
}

.el-header .el-row .el-col .userInfo .userMes .user p:last-child {
  color: rgba(191, 202, 222, 1);
}

/* 侧边栏区域 */

.el-aside .el-menu {
  width: 230px;
  border-right: none;
}

.el-aside .el-menu .el-submenu .el-submenu__title i[class$="icon"] {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0 10px 5px 0;
  background-size: 16px 16px;
}

.el-aside .el-menu .el-submenu:nth-of-type(5) .el-row .el-col:first-child div {
  position: relative;
}

.el-aside
  .el-menu
  .el-submenu:nth-of-type(5)
  .el-row
  .el-col:first-child
  .chatBubble {
  position: absolute;
  top: 0px;
  right: 4px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  background-color: rgba(126, 114, 242, 1);
}

.el-aside .el-menu h1 {
  width: 160px;
  height: 24px;
  opacity: 1;
  font-family: "阿里妈妈数黑体 Bold";
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
  color: rgba(126, 114, 242, 1);
  text-align: center;
  vertical-align: top;
  margin: 25px;
}

.el-aside .el-menu .switchCompany,
.company {
  display: flex;
  align-items: center;
}

.el-aside .el-menu .switchCompany {
  position: relative;
  width: 210px;
  height: 56px;
  opacity: 1;
  border-radius: 5px;
  background: rgba(4, 8, 33, 1);
  margin: 0 9px;
}

.el-aside .el-menu .switchCompany .image {
  width: 40px;
  height: 40px;
  margin-left: 10px;
}

.el-aside .el-menu .switchCompany .image img {
  width: 100%;
}

.el-aside .el-menu .switchCompany .text {
  margin-left: -4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 19.6px;
  color: rgba(255, 255, 255, 1);
}

.el-aside .el-menu .switchCompany .text p:first-child {
  margin-left: 13px;
}

.el-aside .el-menu .switchCompany .text p:last-child {
  font-size: 12px;
  font-weight: 500;
  line-height: 16.8px;
  opacity: 0.4;
  color: rgba(255, 255, 255, 1);
  margin: 2px 0 0 14px;
}

.el-aside .el-menu .switchCompany .icon {
  width: 14px;
  height: 14px;
  line-height: 14px;
  opacity: 0.33;
  color: rgba(255, 255, 255, 1);
  margin-left: 13px;
}

.el-aside .el-menu .switchCompany:hover .companyList {
  cursor: pointer;
  display: block;
  z-index: 999;
}

.el-aside .el-menu .switchCompany .companyList {
  display: none;
  position: absolute;
  top: 0px;
  left: 0px;
  width: 210px;
  height: 199px;
  opacity: 1;
  border-radius: 5px;
  background: rgba(255, 255, 255, 1);
}

.el-aside .el-menu .switchCompany .companyList .company {
  height: 65px;
}

.el-aside .el-menu .switchCompany .companyList .company .text p:first-child {
  color: rgba(52, 69, 99, 1);
}

.el-aside .el-menu .switchCompany .companyList .company .text p:last-child {
  opacity: 1;
  color: rgba(167, 180, 204, 1);
}

.el-aside .elAsideDiv {
  color: white;
  margin: 20px 60px 20px 70px;
}

.el-aside .elAsideDiv:hover {
  color: rgba(172, 163, 255, 1);
  cursor: pointer;
}
</style>
